home *** CD-ROM | disk | FTP | other *** search
/ PC User 2003 January / Disc 3 / Amethyst.iso / live / usr / share / vim / vimrc < prev   
Encoding:
Text File  |  2002-06-19  |  3.4 KB  |  146 lines

  1. " An example for a vimrc file.
  2. "
  3. " Maintainer:    Bram Moolenaar <Bram@vim.org>
  4. " Last change:    2001 Jul 18
  5. "
  6. " To use it, copy it to
  7. "     for Unix and OS/2:  ~/.vimrc
  8. "          for Amiga:  s:.vimrc
  9. "  for MS-DOS and Win32:  $VIM\_vimrc
  10. "        for OpenVMS:  sys$login:.vimrc
  11.  
  12. " When started as "evim", evim.vim will already have done these settings.
  13. if v:progname =~? "evim"
  14.   finish
  15. endif
  16.  
  17. " Use Vim settings, rather then Vi settings (much better!).
  18. " This must be first, because it changes other options as a side effect.
  19. set nocompatible
  20.  
  21. " allow backspacing over everything in insert mode
  22. set backspace=indent,eol,start
  23.  
  24. set autoindent        " always set autoindenting on
  25. set showmatch        " jump emacs style to matching bracket
  26. set incsearch        " highlight match while typing search pattern
  27.  
  28. if has("vms")
  29.   set nobackup        " do not keep a backup file, use versions instead
  30. else
  31.   " set backup        " keep a backup file
  32. endif
  33. set history=50        " keep 50 lines of command line history
  34. set ruler        " show the cursor position all the time
  35. set showcmd        " display incomplete commands
  36. set incsearch        " do incremental searching
  37.  
  38. " For Win32 GUI: remove 't' flag from 'guioptions': no tearoff menu entries
  39. " let &guioptions = substitute(&guioptions, "t", "", "g")
  40.  
  41. " Don't use Ex mode, use Q for formatting
  42. map Q gq
  43.  
  44. " Make p in Visual mode replace the selected text with the "" register.
  45. vnoremap p <Esc>:let current_reg = @"<CR>gvs<C-R>=current_reg<CR><Esc>
  46.  
  47. " This is an alternative that also works in block mode, but the deleted
  48. " text is lost and it only works for putting the current register.
  49. "vnoremap p "_dp
  50.  
  51. " Switch syntax highlighting on, when the terminal has colors
  52. " Also switch on highlighting the last used search pattern.
  53. if &t_Co > 2 || has("gui_running")
  54.   syntax on
  55.   set hlsearch
  56. endif
  57.  
  58. " Only do this part when compiled with support for autocommands.
  59. if has("autocmd")
  60.  
  61.   " Enable file type detection.
  62.   " Use the default filetype settings, so that mail gets 'tw' set to 72,
  63.   " 'cindent' is on in C files, etc.
  64.   " Also load indent files, to automatically do language-dependent indenting.
  65.   filetype plugin indent on
  66.  
  67.   " For all text files set 'textwidth' to 78 characters.
  68.   autocmd FileType text setlocal textwidth=78
  69.  
  70.   " When editing a file, always jump to the last known cursor position.
  71.   " Don't do it when the position is invalid or when inside an event handler
  72.   " (happens when dropping a file on gvim).
  73.   autocmd BufReadPost *
  74.     \ if line("'\"") > 0 && line("'\"") <= line("$") |
  75.     \   exe "normal g`\"" |
  76.     \ endif
  77.  
  78. endif " has("autocmd")
  79. if &term =~ "xterm.*"
  80.   " Tastatur-Belegung fuer diverse  vi's
  81.   " Autor: Werner Fink   <werner@suse.de> 
  82.   " Version: 20.05.1997
  83.  
  84.   " keys in display mode
  85.   map OA  k
  86.   map A  k
  87.   map OB  j
  88.   map B  j
  89.   map OD  h
  90.   map D  h
  91.   map     h
  92.   map     h
  93.   map OC  l
  94.   map C  l
  95.   map ~ i
  96.   map ~ x
  97.   map ~ 0
  98.   map OH  0
  99.   map H  0
  100.   map ~ $
  101.   map OF  $
  102.   map F  $
  103.   map ~ 
  104.   map ~ 
  105.   map E  ""
  106.   map G  ""
  107.   map OE  ""
  108.   map Oo  :
  109.   map Oj  *
  110.   map Om  -
  111.   map Ok  +
  112.   map Ol  +
  113.   map OM  
  114.   map Ow  7
  115.   map Ox  8
  116.   map Oy  9
  117.   map Ot  4
  118.   map Ou  5
  119.   map Ov  6
  120.   map Oq  1
  121.   map Or  2
  122.   map Os  3
  123.   map Op  0
  124.   map On  .
  125.  
  126.   " keys in insert mode
  127.   map! Oo  :
  128.   map! Oj  *
  129.   map! Om  -
  130.   map! Ok  +
  131.   map! Ol  +
  132.   map! OM  
  133.   map! Ow  7
  134.   map! Ox  8
  135.   map! Oy  9
  136.   map! Ot  4
  137.   map! Ou  5
  138.   map! Ov  6
  139.   map! Oq  1
  140.   map! Or  2
  141.   map! Os  3
  142.   map! Op  0
  143.   map! On  .
  144.   map!  
  145. endif
  146.